<template>
  <div class="statistics-index">
    <div class="tab-box">
      <div
        :class="['item', index === tabIndex ? 'active' : '']"
        v-for="(item, index) in tabArr"
        @click="changeTab(index)"
      >
        <i :class="item.imgUrl"></i>
        <span>{{ item.text }}</span>
      </div>
    </div>
    <div class="con-box">
      <Equipment v-if="tabIndex === 0"  />
      <Classify v-if="tabIndex === 1" />
      <Value v-if="tabIndex === 2" />
    </div>
  </div>
</template>
<script>
import IconTitle from "@/components/icon-title/index.vue";
import Classify from './classify.vue'
import Equipment from './equipment.vue'
import Value from './value.vue'
export default {
  name: "statistics",
  components: {
      IconTitle,
      Classify,
      Equipment,
      Value
  },

  data() {
    return {
      tabArr: [
        { imgUrl: "icon-ziliao", text: "设备统计" },
        { imgUrl: "icon-guzhangweihu", text: "分类统计" },
        { imgUrl: "icon-gwfenlei", text: "价值统计" },
      ],
      tabIndex: 0,
    };
  },
  created() {
   
  },
  mounted() {},
  methods: {
    changeTab(index) {
      this.tabIndex = index;
    },
  },
};
</script>
<style lang="scss" >
@import "@/styles/color.scss";
.statistics-index {
  width: 100%;
  margin-bottom: 50px;
  .tab-box {
    width: 100%;
    background: #fff;
    padding: 10px 15px;
    height: 55px;
    box-sizing: border-box;
    display: flex;
    border-radius: 4px;
    position: fixed;
    top: 115px;
    z-index: 10;
    .item {
      padding: 3px 5px;
      cursor: pointer;
      margin-right: 30px;
      border-radius: 4px;
      color: #666;
      display: flex;
      align-items: center;
      font-size: 15px;
      i {
        margin-right: 5px;
      }
    }
    .item.active {
      background: $theme;
      color: #fff;
    }
  }
  .con-box {
    margin-top: 65px;
    width: 100%;
    //各个组件公共样式
    .table-box {
      margin-top: 10px;
      background: #fff;
      padding: 10px 15px;
      border-radius: 4px;
      box-sizing: border-box;
      .echarts-box {
        width: 100%;
        margin-top: 10px;
        .echarts-item {
          padding: 10px 15px;
          background: #fff;
          height: 250px;
          box-shadow: 0px 0px 7px 0px #eff2f5;
          .item-title {
            display: flex;
            align-items: center;
            i {
              color: #c9c184;
              margin-right: 5px;
            }
            span {
              font-size: 14px;
            }
            p {
              margin-left: 10px;
              padding: 0 5px;
              border: 1px solid #ccc;
              border-radius: 15px;
              font-weight: bold;
            }
          }
        }
        .echarts-item-classify{
          height: 360px;
        }
      }
      .el-table {
        margin-top: 10px;
      }
    }
    .box-card {
      margin-top: 10px;
      .btn-box {
        margin-bottom: 20px;
      }
    }
  }
}
</style>
